package viewmodel

import (
	"github.com/sirupsen/logrus"
	"gorm.io/gorm"
)

type ConfigContext struct {
	Db  *gorm.DB
	Log *logrus.Logger
}

type InitConfig struct {
	Base    Base    `yaml:"base" json:"base"`
	Log     Log     `yaml:"log" json:"log"`
	Mysql   Mysql   `yaml:"mysql" json:"mysql"`
	JwtAuth JwtAuth `yaml:"jwtAuth" json:"jwtAuth"`
}

type Log struct {
	Level      string `yaml:"level" json:"level"`
	Path       string `yaml:"path" json:"path"`
	MaxSize    int    `yaml:"maxsize" json:"maxsize"`
	MaxAge     int    `yaml:"maxage" json:"maxage"`
	MaxBackups int    `yaml:"maxbackups" json:"maxbackups"`
}

type Mysql struct {
	User     string `yaml:"user" json:"user"`
	PassWord string `yaml:"password" json:"password"`
	Host     string `yaml:"host" json:"host"`
	Port     int    `yaml:"prot" json:"prot"`
	DbName   string `yaml:"dbname" json:"dbname"`
}

type Base struct {
	Env string `yaml:"env" json:"env"`
}

type JwtAuth struct {
	Secret     string `yaml:"secret" json:"secret"`
	ExpireTime int    `yaml:"expiretime" json:"expiretime"`
}
